﻿using System;
using System.IO;
using UnityEngine;

namespace Character
{
	// Token: 0x020001A9 RID: 425
	public class HairPartParameter : ParameterBase
	{
		// Token: 0x06000AF8 RID: 2808 RVA: 0x0003F0F0 File Offset: 0x0003D2F0
		public HairPartParameter(SEX sex) : base(sex)
		{
			this.Init();
		}

		// Token: 0x06000AF9 RID: 2809 RVA: 0x0003F100 File Offset: 0x0003D300
		public HairPartParameter(HairPartParameter copy) : base(copy.sex)
		{
			this.Copy(copy);
		}

		// Token: 0x06000AFA RID: 2810 RVA: 0x0003F118 File Offset: 0x0003D318
		public void Init()
		{
			this.ID = 0;
			this.hairColor = new ColorParameter_Hair();
			this.acceColor = null;
		}

		// Token: 0x06000AFB RID: 2811 RVA: 0x0003F134 File Offset: 0x0003D334
		public void Copy(HairPartParameter copy)
		{
			this.ID = copy.ID;
			if (copy.hairColor != null)
			{
				this.hairColor = new ColorParameter_Hair(copy.hairColor);
			}
			else
			{
				this.hairColor = null;
			}
			if (copy.acceColor != null)
			{
				this.acceColor = new ColorParameter_PBR1(copy.acceColor);
			}
			else
			{
				this.acceColor = null;
			}
		}

		// Token: 0x06000AFC RID: 2812 RVA: 0x0003F1A0 File Offset: 0x0003D3A0
		public void Save(BinaryWriter writer, SEX sex)
		{
			base.Write(writer, this.ID);
			if (this.hairColor != null)
			{
				this.hairColor.Save(writer);
			}
			else
			{
				writer.Write(0);
			}
			if (this.acceColor != null)
			{
				this.acceColor.Save(writer);
			}
			else
			{
				writer.Write(0);
			}
		}

		// Token: 0x06000AFD RID: 2813 RVA: 0x0003F200 File Offset: 0x0003D400
		public void Load(BinaryReader reader, SEX sex, CUSTOM_DATA_VERSION version)
		{
			base.Read(reader, ref this.ID);
			if (version <= CUSTOM_DATA_VERSION.DEBUG_03)
			{
				Color white = Color.white;
				base.Read(reader, ref white);
				if (version <= CUSTOM_DATA_VERSION.DEBUG_00)
				{
					return;
				}
				base.Read(reader, ref white);
			}
			else
			{
				this.hairColor.Load(reader, version);
				if (this.acceColor == null)
				{
					this.acceColor = new ColorParameter_PBR1();
				}
				if (!this.acceColor.Load(reader, version))
				{
					this.acceColor = null;
				}
			}
		}

		// Token: 0x04000B4E RID: 2894
		public int ID;

		// Token: 0x04000B4F RID: 2895
		public ColorParameter_Hair hairColor;

		// Token: 0x04000B50 RID: 2896
		public ColorParameter_PBR1 acceColor;
	}
}
